package com.example.octopus.controller;


import com.example.octopus.entity.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/api/login")
public class AdminController {
    @Autowired
    private Admin admin;
    @RequestMapping("/admilogin")//管理员登录
    public Map<String,Object> admilogin(){
        Map<String,Object> admap = new HashMap<String,Object>();
        Map<String,Object> administrator = new HashMap<String,Object>();
        admap.put("status",200);
        administrator.put("account",admin.getAccount());
        administrator.put("password",admin.getPassword());
        administrator.put("avatar",admin.getAvatar());
        admap.put("administrator",administrator);
        return admap;
    }

}
